//设置
import React, { Component } from 'react';
import {
    View,
} from 'react-native';

import { SelxzLonginAction } from '../../../actions/systemAction'
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';


import Follow_top from './install_top';
import Follow_body from './install_body';



class Follow_com extends Component {
    constructor(props) {
        super(props);
    }
    //加载后渲染页面
    componentDidMount() {
        this.props.actions.SelxzLonginAction(); //初始化查询
    }
    render() {
        return (
            <View style={{ backgroundColor: '#eeeeee', flex: 1 }}>
                <Follow_top navigation={this.props.navigation} />
                <Follow_body
                    msg={this.props.msg.data}
                    navigation={this.props.navigation} />
            </View>
        )
    }
}

//组合action
var actions = {
    SelxzLonginAction
}
//连接state到props
const mapStateToProps = state => {
    return {
        msg: state.SelxzLonginReducer
    }
}
//连接action
const mapDispatchToProps = (dispatch) => {
    return {
        actions: bindActionCreators(actions, dispatch)
    }
}
//导出组合好的组件(组合后状态改变重新渲染组合组件的页面)
export default connect(
    mapStateToProps, mapDispatchToProps
)(Follow_com);